<extend name="Public/layout"/>


<style>
    .pagination {
        font-size: 0;
    }
    .pagination .page-item,
    .pagination .prev,
    .pagination .next,
    .pagination .dotted {
        display: inline-block;
        height: 32px;
        line-height: 32px;
        text-align: center;
        font-size: 14px;
    }
    .pagination .page-item,
    .pagination .prev,
    .pagination .next {
        border: 1px solid #ddd;
        color: #ddd;
        margin-left: 8px;
        vertical-align: top;
    }
    .pagination a.page-item,
    .pagination a.prev,
    .pagination a.next {
        color: #666666;
    }
    .pagination a.page-item:hover,
    .pagination a.prev:hover,
    .pagination a.next:hover {
        border-color: #ff7e00;
        color: #ff7e00;
        text-decoration: none;
    }
    .pagination .page-item {
        min-width: 24px;
        _width: 24px;
        padding: 0 4px;
        font-family: tahoma;
    }
    .pagination .prev,
    .pagination .next {
        width: 73px;
    }
    .pagination .prev {
        margin-left: 0;
    }
    .pagination .prev b {
        padding-right: 6px;
    }
    .pagination .next b {
        padding-left: 6px;
    }
    .pagination .dotted {
        margin: 0 5px 0 16px;
        color: #8C8C8C;
    }
    .pagination .current {
        background: #ff7e00;
        border-color: #ff7e00;
        color: #fff !important;
    }
    .num {
        padding: 10px;
        background: #00a157;
        border: 1px solid #00acd6;
    }

</style>

<block name="body">
    <div class="row">
        <div class="col-xs-12">
            <div class="box flat box-primary">
                <div class="box-body aaaaaa" id="{$boxId}">


                    <div class="table-wrap">
                        <table id="{$tableId}"
                               class="table table-bordered table-hover table-condensed table-nowrap"
                               data-table-name="{$tableId}">
                            <thead>
                            <tr>
                                <th style="text-align: center;vertical-align: middle;" style="background: linear-gradient(45deg, #f43f3b, #ec008c);">今日录单</th>
                                <th style="text-align: center" style="background: linear-gradient(45deg, #0081ff, #1cbbb4);">今日订单</th>
                                <th style="text-align: center" style="background: linear-gradient(45deg, #f43f3b, #ec008c);">今日金额</th>
                                <th style="text-align: center" style="background: linear-gradient(45deg, #0081ff, #1cbbb4);">今日预估</th>
                                <th style="text-align: center" style="background: linear-gradient(45deg, #f43f3b, #ec008c);">昨天订单</th>
                                <th style="text-align: center" style="background: linear-gradient(45deg, #0081ff, #1cbbb4);;">昨天预估</th>
                            </tr>

                            </thead>
							<style type="text/css">
								.ah td{
									padding: 20px 5px;
								}
								.cp_th{
									background-color: #34ccce;padding: 10px;
								}
							</style>
                            <tbody class="ah">

                                <tr>
                                    <td style="text-align: center">{$alldata['today_input_count']||default="0"}</td>
                                    <td style="text-align: center">{$alldata['today_order_count']||default="0"}</td>
                                    <td style="text-align: center">{$alldata['today_money']||default="0"}</td>
                                    <td style="text-align: center">{$alldata['today_yugu']||default="0"}</td>
                                    <td style="text-align: center">{$alldata['yestoday_order_count']||default="0"}</td>
                                    <td style="text-align: center">{$alldata['yestoday_yugu']||default="0"}</td>
                                </tr>

                            </tbody>
                        </table>

                        <table id="{$tableId}2"
                               class="table table-bordered table-hover table-condensed table-nowrap" style="margin-top: 30px;"
                               data-table-name="{$tableId}2">
                            <thead>
                            <tr>
                                <th style="text-align: center;vertical-align: middle;" style="background: linear-gradient(45deg, #f43f3b, #ec008c);">本月录单</th>
                                <th style="text-align: center" style="background: linear-gradient(45deg, #0081ff, #1cbbb4);">本月订单</th>
                                <th style="text-align: center" style="background: linear-gradient(45deg, #f43f3b, #ec008c);">本月预估</th>
                                <th style="text-align: center" style="background: linear-gradient(45deg, #0081ff, #1cbbb4);">上月录单</th>
                                <th style="text-align: center" style="background: linear-gradient(45deg, #f43f3b, #ec008c);">上月订单</th>
                                <th style="text-align: center" style="background: linear-gradient(45deg, #0081ff, #1cbbb4);">上月预估</th>
                            </tr>

                            </thead>
                            <tbody class="ah">

                            <tr>
                                <td style="text-align: center">{$alldata['thismon_input']||default="0"}</td>
                                <td style="text-align: center">{$alldata['thismon_order']||default="0"}</td>
                                <td style="text-align: center">{$alldata['thismon_yugu']||default="0"}</td>
                                <td style="text-align: center">{$alldata['lastmon_input']||default="0"}</td>
                                <td style="text-align: center">{$alldata['lastmon_order']||default="0"}</td>
                                <td style="text-align: center">{$alldata['lastmon_yugu']||default="0"}</td>
                            </tr>

                            </tbody>
                        </table>

                        <div class="dataTables_tool clearfix" style="margin-top: 10px;">
                            <form>
                                <div class="input-group date" style="width: 204px; float: left;">
                                    <div class="input-group-addon"><i class="fa fa-calendar"></i></div>
                                    <input type="hidden" name="start_time" class="text date"
                                           value="{:I('get.start_time')}"/>
                                    <input style="width: auto;" type="text" data-name="start_time"
                                           class="form-control date datepicker" value="{:I('get.start_time')}"
                                           placeholder="请选择开始日期"
                                           data-type="date"/>
                                </div>
                                <div class="input-group date" style="width: 204px; float: left;margin-left: 10px;">
                                    <div class="input-group-addon"><i class="fa fa-calendar"></i></div>
                                    <input type="hidden" name="end_time" class="text date"
                                           value="{:I('get.end_time')}"/>
                                    <input style="width: auto;" type="text" data-name="end_time"
                                           class="form-control date datepicker" value="{:I('get.end_time')}"
                                           placeholder="请选择结束日期"
                                           data-type="date"/>
                                </div>

                                <div class="input-group date" style="width: 204px; float: left;margin-left: 10px;">

                                   <select name="validCode" class="form-control">
                                       <option <php>if($validCode == 1)echo "selected"</php> value="1">全部</option>
                                       <option  <php>if($validCode == 15)echo "selected"</php> value="15">待付款</option>
                                       <option  <php>if($validCode == 16)echo "selected"</php> value="16">已付款</option>
                                       <option   <php>if($validCode == 17)echo "selected"</php> value="17">已完成</option>
                                       <option  <php>if($validCode == 18)echo "selected"</php> value="18">已结算</option>
                                       <option  <php>if($validCode == 30)echo "selected"</php> value="30">无效</option>
                                   </select>
                                </div>
                                <div class="input-group date" style="width: 204px; float: left;margin-left: 10px;">

                                    <input type="text" name="ordersn" class="form-control"
                                           value="{:I('get.ordersn')}" placeholder="输入订单号"/>
                                </div>
                                <button style="line-height: 20px;margin-top:auto;margin-left: 10px;" type="submit"
                                        class="btn btn-flat _dt_btns_ btn-default" data-callback="form"
                                        data-param="">
                                    搜索
                                </button>
                            </form>
                        </div>


                        <table id="{$tableId}4"
                               class="table table-bordered table-hover table-condensed table-nowrap" style="margin-top: 10px;"
                               data-table-name="{$tableId}4">
                            <thead>
                            <tr>
                                <th style="text-align: center;vertical-align: middle; width: 280px;">商品信息</th>
                                <th style="text-align: center;vertical-align: middle;width: 140px;">订单号</th>
                                <th style="text-align: center">订单状态</th>
                                <th style="text-align: center">活动ID</th>
                                <th style="text-align: center;width: 150px;">时间</th>
                                <th style="text-align: center">预估金额</th>
                                <th style="text-align: center">预估佣金</th>
                                <th style="text-align: center">团长费用</th>
                                <th style="text-align: center">分成比例</th>
                                <th style="text-align: center">实际金额</th>
                                <th style="text-align: center">实际佣金</th>
                                <th style="text-align: center">数量</th>
                            </tr>

                            </thead>
                            <tbody>
                            <if condition="$list">
                            <foreach name="list" item="row2">
                                <tr>
                                    <td style="text-align: left; width: 280px;"><div><img src="{$row2['logo_img']}" width="80px" /><br/>{$row2['title']}<br/><b style="color: red">{$row2['price']}</b></div></td>
                                    <td style="text-align: center">{$row2['order_no']}</td>
                                    <td style="text-align: center">{$row2['order_state_label']}</td>
                                    <td style="text-align: center">{$row2['taobao_act_id']}</td>
                                    <td style="text-align: center; text-align: left; width: 210px;"><div>下单时间：<br />{$row2['order_time']}<br />完成时间：<br />{$row2['finish_time']}<br />结算时间：<br />{$row2['pay_month']}</div></td>
                                    <td style="text-align: center">{$row2['estimateCosPrice']}</td>
                                    <td style="text-align: center">{$row2['estimateFee']}</td>
                                    <td style="text-align: center">{$row2['commissionRate']}</td>
                                    <td style="text-align: center">{$row2['finalRate']}</td>
                                    <td style="text-align: center">{$row2['actualCosPrice']}</td>
                                    <td style="text-align: center">{$row2['actualFee']||default="0.00"}</td>
                                    <td style="text-align: center">商品数量：{$row2['skuNum']}<br />售后数量：{$row2['frozenSkuNum']}<br />退货数量：{$row2['skuReturnNum']}</td>
                                </tr>
                            </foreach>
                                <else />
                                <tr>
                                    <td colspan="11" style="height: 200px; margin: 0px auto; text-align: center; vertical-align: middle; line-height: 200px;">
                                        暂无数据，或维护中..
                                    </td>
                                </tr>
                            </if>
                            </tbody>
                        </table>

                        <div style="float: right">{$page}</div>

                    </div>
                </div>
            </div>
        </div>
    </div>

    <script>
        $(function () {
            $('.form-control.date.datepicker').change(function () {
                $(this).prev().val($(this).val());
            });

            $('.datepicker').each(function () {
                var $this = $(this);
                var dateType = $(this).attr('data-type');
                var handle = "datepicker";
                var format = "yyyy-mm-dd";
                var options = {
                    language: 'zh-CN',
                    autoclose: true,
                    templates: {
                        leftArrow: '<i class="fa fa-caret-square-o-left"></i>',
                        rightArrow: '<i class="fa fa-long-arrow-right"></i>'
                    },
                }
                switch (dateType) {
                    case 'timestamp':
                    case 'datetime':
                        format = "yyyy-mm-dd hh:ii";
                        handle = 'datetimepicker';
                        break;
                    case 'date':
                        format = "yyyy-mm-dd";
                        handle = 'datepicker';
                        break;
                }
                options.format = format;
                var fieldName = $this.attr('data-name');
                $this[handle](options)
                    .on('changeDate,change', function (e) {
                        var value = $(e.currentTarget).val();
                        $('input[name=' + fieldName + ']').val(value);
                    });
            });
        });
    </script>
</block>